package priv.mill.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import priv.mill.model.Car;
//- 价格
//- 品牌
//- 排量
//- 马力
//- 颜色
@Controller
@RequestMapping("cars")
@SessionAttributes(names= {"cars"})
public class CarsController {
	private static List<Car> cars=new ArrayList<>();
	{
		cars.add(new Car(12312.2,"马自达",2.3,2.2,"蓝色"));
		cars.add(new Car(12312.2,"宝马",2.3,2.2,"白色"));
		cars.add(new Car(12312.2,"奔驰",2.3,2.2,"红色"));
		cars.add(new Car(12312.2,"大众",2.3,2.2,"黑色"));
	}
	@GetMapping("all")
	public String findAll(Map<String,Object>map) {
		map.put("cars",cars);
		return "bs/cars";
		
	}
}
